namespace Expect.Documentation.Advanced_concepts
{
    using System;
    using Expect.Core;
    using Expect.Core.Fixtures;
    using Microsoft.VisualStudio.TestTools.UnitTesting;
    
    
    // This file is generated, if you modify content you will lose your modifications when the generator will regenerate the file
    [System.CodeDom.Compiler.GeneratedCodeAttribute("Expect.Core", "0.5.2.0")]
    [System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
    [TestClass()]
    [SpecificationContainerAttribute(Name="Advanced setup and teardown", Path="\\Advanced concepts\\Advanced setup and teardown.expect")]
    public partial class AdvancedSetupAndTeardownContainer : Expect.Core.AbstractSpecificationContainer
    {
        
        partial void PrepareContextExtension();
        
        partial void BeforeInitExtension();
        
        partial void AfterInitExtension();
        
        partial void BeforeTeardownExtension();
        
        partial void AfterTeardownExtension();
        
#line 1 "Advanced setup and teardown.expect"
#line hidden
        
        public override void InitializeContext()
        {
            base.InitializeContext();
            PrepareContextExtension();
        }
        
        [TestInitialize()]
        public virtual void AdvancedSetupAndTeardownClass_TestInit()
        {
            InitializeContext();
            BeforeInit();
            BeforeInitExtension();

            SpecificationDefinition spec = new SpecificationDefinition();
            Context.GetSetupFrom(spec, "Advanced concepts\\Using setup and teardown from another specification file");
            spec.CalculateResult();

            if ((spec.Status.Success.HasValue == false))
            {
                Assert.Inconclusive(spec.GetMessageForInconclusiveResult());
            }
            if ((spec.Status.Success.Value == false))
            {
                Assert.Fail(spec.GetMessageForFailedResult());
            }

            AfterInit();
            AfterInitExtension();
        }
        
        [TestCleanup()]
        public virtual void AdvancedSetupAndTeardownClass_TestTeardown()
        {
            BeforeTeardown();
            BeforeTeardownExtension();

            SpecificationDefinition spec = new SpecificationDefinition();
            Context.GetTeardownFrom(spec, "Advanced concepts\\Using setup and teardown from another specification file");
            spec.CalculateResult();

            if ((spec.Status.Success.HasValue == false))
            {
                Assert.Inconclusive(spec.GetMessageForInconclusiveResult());
            }
            if ((spec.Status.Success.Value == false))
            {
                Assert.Fail(spec.GetMessageForFailedResult());
            }

            AfterTeardown();
            AfterTeardownExtension();
        }
        
        // TestComment
        [TestMethod()]
        public virtual void AdvancedSetupAndTeardown_UsingSetupAndTeardownFromAnotherFile()
        {
            SpecificationDefinition spec = new SpecificationDefinition();
            Get_UsingSetupAndTeardownFromAnotherFile(spec);
            spec.CalculateResult();

            if ((spec.Status.Success.HasValue == false))
            {
                Assert.Inconclusive(spec.GetMessageForInconclusiveResult());
            }
            if ((spec.Status.Success.Value == false))
            {
                Assert.Fail(spec.GetMessageForFailedResult());
            }
        }
        
        [SpecificationProviderAttribute(Name="using setup and teardown from another file")]
        public virtual void Get_UsingSetupAndTeardownFromAnotherFile(Expect.Core.SpecificationDefinition spec)
        {
            spec.Context = Context;
            spec.Name = "using setup and teardown from another file";
            FixtureDefinition fixture = null;

            fixture = spec.AddFixture<DescriptionFixture>();
#line 7
            fixture.WithRow("You could use a setup or teardown bloc from another file in your specification to" +
                    " do this you must use a @setupfrom or @teardownfrom bloc followed by the relativ" +
                    "e path to the file");
#line 8
            fixture.WithRow("For example this specification use this setup by declaring :");
#line 9
            fixture.WithRow("{{");
#line 10
            fixture.WithRow(" @setupfrom Advanced concepts\\Using setup and teardown from another specification" +
                    " file");
#line 11
            fixture.WithRow(" @teardownfrom Advanced concepts\\Using setup and teardown from another specificat" +
                    "ion file");
#line 12
            fixture.WithRow("}}");
#line hidden
            fixture.EndRun();

            fixture = spec.AddFixture();
#line 14
            fixture.WithRow("This specification will use setup and teardown from another file");
#line hidden
            fixture.EndRun();

        }
    }
}
